package com.heima.wemedia.feign;

import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmNewsService;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: xrl
 * @Date: 2022/10/21  19:35
 * @Version 1.0
 */
@RestController
public class WmSensitiveClient {

    @Autowired
    private WmSensitiveService wmSensitiveService;

    @Autowired
    private WmNewsService wmNewsService;

    /**
     * 查询敏感词列表
     */
    @PostMapping("/api/v1/sensitive/list")
    public ResponseResult list(@RequestBody SensitiveDto dto) {
        return wmSensitiveService.getList(dto);
    }

    /**
     * 删除敏感词
     */
    @DeleteMapping("/api/v1/sensitive/del/{id}")
    public ResponseResult delSensitive(@PathVariable("id") Integer id) {
        return wmSensitiveService.deleteById(id);
    }

    /**
     * 添加敏感词
     */
    @PostMapping("/api/v1/sensitive/save")
    public ResponseResult saveSensitive(@RequestBody WmSensitive wmSensitive) {
        return wmSensitiveService.saveSensitive(wmSensitive);
    }

    /**
     * 修改敏感词
     */
    @PostMapping("/api/v1/sensitive/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitive wmSensitive) {
        return wmSensitiveService.updateSensitive(wmSensitive);
    }
















//    /**
//     * 媒体审核
//     */
//    @PostMapping("/api/v1/news/list_vo")
//    public ResponseResult ToExamine(@RequestBody NewsAuthDto dto) {
//        return wmNewsService.ToExamine(dto);
//    }


}
